import 'package:flutter/material.dart';

import 'ChildCase.dart';

class ParentCase extends StatefulWidget {
  const ParentCase({Key? key}) : super(key: key);

  @override
  _ParentCaseState createState() => _ParentCaseState();
}

class _ParentCaseState extends State<ParentCase> {
  int count = 0;
  updateVale(int value) {
    setState(() {
      count = value;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Column(crossAxisAlignment: CrossAxisAlignment.center, children: [
      Text(
        '父组件标题',
        style: TextStyle(fontSize: 30),
      ),
      ChildCase(count: count, updateCallBack: updateVale)
    ]);
  }
}
